package com.briup.springbootredis.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @Author briup-teacher
 * @Date 2023-11
 **/
@Component
public class MyTestTask {

    // private Mapper mapper;

    @Scheduled(cron = "0/10 * * * * ? ") //当项目启动后，当计划发生 自动调用该方法
    public void myTask(){
        LocalDateTime now = LocalDateTime.now();
        System.out.println("myTask2...."+now);
    }
}
